package com.hgw.Demo01_ChainOfResponsibilityPattern.Exercises16_8_6;

/**
 * Data time:2021/12/16 16:23
 * StudentID:2019112118
 * Author:hgw
 * Description: 抽象处理者
 */
public abstract class Handler {
    protected Handler successor;    // 定义后继对象
    private String name;

    public Handler(String name) {
        this.name = name;
    }

    public void setSuccessor(Handler successor) {
        this.successor = successor;
    }

    public String getName() {
        return name;
    }

    public abstract void handleLeave(LeaveRequest leave);
}
